﻿using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BYUStock.DB
{
    public static class DbHelper
    {
        public static readonly string CONN_STR = "Data Source =" + AppDomain.CurrentDomain.BaseDirectory + "stock_base.db;";

        public static SQLiteDataReader ExecuteReader(string sql)
        {
            using (var conn = new SQLiteConnection(CONN_STR))
            {
                conn.Open();
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = sql;
                    return cmd.ExecuteReader();
                }
            }
        }
    }
}
